
import xlrd
def read_excel(fileName: str, bookName: str, index: int = 0):
    new_list = []  # 创建一个列表接受每一行的数据
    wb = xlrd.open_workbook(fileName)
    # 根据bookName获取表对象
    book = wb.sheet_by_name(bookName)
    for a in range(index, book.nrows):  # 遍历表中所有行的数据
        new_list.append(tuple(book.row_values(a)))  # 把每一行的数据变成元组，追加到列表中
    return new_list




